﻿using System.Collections.Generic;
using NExt.data;
using NExt.Core.Model.Base;

namespace NExt.tree
{
    public class TreeNode : TreeNode<TreeNodeEvents>
    {
    }

    public abstract class TreeNode<TEvents> : Node<TEvents>
        where TEvents : TreeNodeEvents, new()
    {
        protected TreeNode()
        {
            children = new List<object>();
        }

        public bool? allowChildren { get; set; }
        public bool? allowDrag { get; set; }
        public bool? allowDrop { get; set; }
        public bool? checkedd { get; set; }
        public IList<object> children { get; set; }
        public string cls { get; set; }
        public bool? disabled { get; set; }
        public bool? draggable { get; set; }
        public bool? expandable { get; set; }
        public bool? expanded { get; set; }
        public string href { get; set; }
        public string hrefTarget { get; set; }
        public string icon { get; set; }
        public string iconCls { get; set; }
        public bool? isTarget { get; set; }
        public string qtip { get; set; }
        public string qtipCfg { get; set; }
        public bool? singleClickExpand { get; set; }
        public string text { get; set; }
        public AnonymousFunction uiProvider { get; set; }
    }

    public class TreeNodeEvents : NodeEvents
    {
        public IScript beforechildrenrendered { get; set; }
        public IScript beforeclick { get; set; }
        public IScript beforecollapse { get; set; }
        public IScript beforeexpand { get; set; }
        public IScript checkchange { get; set; }
        public IScript click { get; set; }
        public IScript collapse { get; set; }
        public IScript contextmenu { get; set; }
        public IScript dblclick { get; set; }
        public IScript disabledchange { get; set; }
        public IScript expand { get; set; }
        public IScript textchange { get; set; }
    }
}
